import nme.Assets;
import nme.display.Sprite;
import nme.display.Bitmap;
import nme.display.BitmapData;

import nme.geom.Rectangle;
import nme.geom.Matrix;
import nme.geom.Point;

import nme.events.Event;
import nme.events.MouseEvent;

class ContextMenu extends Sprite
{
	private var _listButton:Array<Label>;
	private var _bound:Rectangle;
	
	public function new (maxWidth:Float = 200)
	{
		super ();
		_listButton = new Array<Label> ();
		_bound = new Rectangle ();
	}
	
	public function update ():Void
	{
		// for (btn in _listButton)
		// {
			// btn.update ();
		// }
	}
	
	public function render ():Void
	{
		// for (btn in _listButton)
		// {
			// btn.render ();
		// }
	}
	
	public function add (btn:Label, listener:MouseEvent->Void):Void
	{
		addChild (btn);
		_listButton.push (btn);
		btn.addEventListener (MouseEvent.CLICK, listener);
		btn.x = 0;
		btn.y = _bound.bottom;
		_bound.bottom += btn.height;
	}
}